package com.iskyline.demo.springcloud.feign.controller;

import com.iskyline.demo.springcloud.feign.remote.BaiDuApi;
import com.iskyline.demo.springcloud.feign.remote.GitHubApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/apiTest/")
public class ApiTestController {

    @Autowired
    private GitHubApi gitHubApi;

    @Autowired
    private BaiDuApi baiDuApi;

    @GetMapping("gitHubSearchRepo")
    public String gitHubSearchRepo(@RequestParam(name = "q") String q){
        return gitHubApi.searchRepo(q);
    }

    @GetMapping("baiDuQuery")
    public String baiDuQuery(@RequestParam(name = "wd") String wd){
        return baiDuApi.query(wd);
    }

}
